btez2 2.2.0
Loading...
Searching...
No Matches
BT-EZ 2 Click Driver

API for configuring and manipulating BT-EZ 2 Click driver. More...

Topics

 BT-EZ 2 Device Settings
 Settings for registers of BT-EZ 2 Click driver.
 BT-EZ 2 MikroBUS Map
 MikroBUS pin mapping of BT-EZ 2 Click driver.

Functions

void btez2_cfg_setup (btez2_cfg_t *cfg)
 BT-EZ 2 configuration object setup function.
err_t btez2_init (btez2_t *ctx, btez2_cfg_t *cfg)
 BT-EZ 2 initialization function.
err_t btez2_generic_write (btez2_t *ctx, uint8_t *data_in, uint16_t len)
 BT-EZ 2 data writing function.
err_t btez2_generic_read (btez2_t *ctx, uint8_t *data_out, uint16_t len)
 BT-EZ 2 data reading function.
void btez2_set_rst_pin (btez2_t *ctx, uint8_t state)
 BT-EZ 2 set RST pin function.
void btez2_reset_device (btez2_t *ctx)
 BT-EZ 2 reset device function.
void btez2_set_cts_pin (btez2_t *ctx, uint8_t state)
 BT-EZ 2 set CTS pin function.
uint8_t btez2_get_rts_pin (btez2_t *ctx)
 BT-EZ 2 get RTS pin function.
void btez2_set_cmd_mode (btez2_t *ctx)
 BT-EZ 2 set cmd mode function.
void btez2_set_data_mode (btez2_t *ctx)
 BT-EZ 2 set data mode function.
void btez2_cmd_action (btez2_t *ctx, uint8_t *cmd, uint8_t *params)
 BT-EZ 2 cmd action function.
void btez2_cmd_set (btez2_t *ctx, uint8_t *cmd, uint8_t *params)
 BT-EZ 2 cmd set function.
void btez2_cmd_get (btez2_t *ctx, uint8_t *cmd, uint8_t *params)
 BT-EZ 2 cmd get function.
void btez2_cmd_profile (btez2_t *ctx, uint8_t *cmd, uint8_t *params)
 BT-EZ 2 cmd profile function.
err_t btez2_read_packet (btez2_t *ctx)
 BT-EZ 2 read packet function.

Detailed Description

API for configuring and manipulating BT-EZ 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ btez2_cfg_setup()

void btez2_cfg_setup ( btez2_cfg_t * cfg)

BT-EZ 2 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See btez2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ btez2_cmd_action()

void btez2_cmd_action ( btez2_t * ctx,
uint8_t * cmd,
uint8_t * params )

BT-EZ 2 cmd action function.

This function sends a specified action command to the Click module.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]cmd: Command string, see BTEZ2_CMD_x action definitions.
[in]params: Command arguments string (optional).
Returns
None.
Note
None.

◆ btez2_cmd_get()

void btez2_cmd_get ( btez2_t * ctx,
uint8_t * cmd,
uint8_t * params )

BT-EZ 2 cmd get function.

This function sends a specified get command to the Click module.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]cmd: Command string, see BTEZ2_CMD_x set/get definitions.
[in]params: Command arguments string (optional).
Returns
None.
Note
None.

◆ btez2_cmd_profile()

void btez2_cmd_profile ( btez2_t * ctx,
uint8_t * cmd,
uint8_t * params )

BT-EZ 2 cmd profile function.

This function sends a specified profile command to the Click module.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]cmd: Command string, see BTEZ2_CMD_x profile definitions.
[in]params: Command arguments string (optional).
Returns
None.
Note
None.

◆ btez2_cmd_set()

void btez2_cmd_set ( btez2_t * ctx,
uint8_t * cmd,
uint8_t * params )

BT-EZ 2 cmd set function.

This function sends a specified set command to the Click module.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]cmd: Command string, see BTEZ2_CMD_x set/get definitions.
[in]params: Command arguments string.
Returns
None.
Note
None.

◆ btez2_generic_read()

err_t btez2_generic_read ( btez2_t * ctx,
uint8_t * data_out,
uint16_t len )

BT-EZ 2 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ btez2_generic_write()

err_t btez2_generic_write ( btez2_t * ctx,
uint8_t * data_in,
uint16_t len )

BT-EZ 2 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]data_in: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ btez2_get_rts_pin()

uint8_t btez2_get_rts_pin ( btez2_t * ctx)

BT-EZ 2 get RTS pin function.

This function returns the request to send pin logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ btez2_init()

err_t btez2_init ( btez2_t * ctx,
btez2_cfg_t * cfg )

BT-EZ 2 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See btez2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ btez2_read_packet()

err_t btez2_read_packet ( btez2_t * ctx)

BT-EZ 2 read packet function.

This function reads a response or event packet from the Click module and stores it in ctx->evt_pkt structure.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ btez2_reset_device()

void btez2_reset_device ( btez2_t * ctx)

BT-EZ 2 reset device function.

This function resets the device by toggling the reset pin logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ btez2_set_cmd_mode()

void btez2_set_cmd_mode ( btez2_t * ctx)

BT-EZ 2 set cmd mode function.

This function sets the command mode by setting the CYSPP pin to high logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ btez2_set_cts_pin()

void btez2_set_cts_pin ( btez2_t * ctx,
uint8_t state )

BT-EZ 2 set CTS pin function.

This function sets the clear to send pin logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ btez2_set_data_mode()

void btez2_set_data_mode ( btez2_t * ctx)

BT-EZ 2 set data mode function.

This function sets the data mode by setting the CYSPP pin to low logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ btez2_set_rst_pin()

void btez2_set_rst_pin ( btez2_t * ctx,
uint8_t state )

BT-EZ 2 set RST pin function.

This function sets the reset pin logic state.

Parameters
[in]ctx: Click context object. See btez2_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.